<template>
<div id="searchmovie">
    <div class="head">
    <div class="hbox">
        <div class="left" @click="back">返回</div>
        <div class="middle">猫眼电影</div>
    </div>
    </div>
    <div class="movieshow">
      <ul>
        <li v-for="s in list" :key="s.id">
            <hr>
            <div id="scroll">
                <div class="head-left">
                    <!-- 海报 -->
                    <van-row gutter="10" >
                        <van-col span="6"><img :src="s.img"></van-col>
                        <van-col span="14">
                            <h3>{{s.nm}}</h3>
                            <span>{{s.enm}}</span>
                            <span class="spantext">{{s.cat}}</span><br>
                            <span>{{s.rt}}</span>
                        </van-col>
                        <van-col span="4">
                            <h3 class="h-active">{{s.sc}}分</h3>
                            <van-button type="primary" class="van-button" color="red" text="购票" @click="buy(s.id)"></van-button>
                        </van-col>
                    </van-row>
            </div>
            </div>
        </li>
    </ul>
    </div>
</div>
</template>

<script>
export default {
    name:'searchmovielist',
    props:['list'],
    data(){
        return {
        }
    },
    methods:{
        back() {
            this.$router.go(-1);
        },
        buy(i){
        console.log('这是i',i)
        this.$router.push({name:'dMovie',params:{id:i}})
        }
    }
}
</script>

<style scoped>
*{
    padding: 0;
    margin: 0;
}
.movieshow{
    margin-top:50px ;
}
.head {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
}

.hbox {
  height: 50px;
  width: 100%;
  background-color: red;
  line-height: 50px;
  text-align: center;
  color: white;
  position: relative;
}
.head .left {
  position: absolute;
  left: 10px;
}
#scroll {
    width: 100%;
    height: 100%;
    overflow: auto;
}
#searchmovie img{
    width: 100%;
    height: 100px;
}
#searchmovie .head-left{
    margin: 15px 0;
    padding: 0 15px;
}
#searchmovie .spantext{
    display: inline-block;
    width: 40vw;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
#searchmovie .h-active{
    color: orange;
    font-weight: 700;
    font-size: 22px;
}
#searchmovie .van-button{
    width: 60px;
    height: 30px;
    line-height: 30px;
    border-radius:5px;
}
</style>